/**
 * 年取得公历节日
 * 		chs: 中文节日名,多语言自行定义映射
 * @param y int|string 年
 * @param k string|null 节日  null:取全年,返回json
 * 		string: 见$.__dateFest的KEY  返回:[chs,y,m,d]
 * @return array|object|null
 * 		k!=null: array [chs,'Y-M-D']  参数异常返回:null
 * 		k==null: json {'Y-M-D':chs}  异常或无节日:空json
 */
$.dateFest = function(y, k=null){
	const DATA=$.__dateFest, KEYS=Object.keys(DATA);
	function FEST(y, k, rt){
		let v=DATA[k]; if(!v) return null; let x=v[1];
		if(typeof x==='function') x = x.call(null, y);
		return rt ? rt[y+'-'+x]=v[0] : [v[0],y+'-'+x];
	}
	$.dateFest = function(y, k=null){
		if(k!==null) return FEST(y,k); let rt={};
		KEYS.forEach(k=>FEST(y,k,rt)); return rt;
	};
	return $.dateFest(y, k);
};
Object.defineProperty($,'__dateFest',{
	value: {
		wetlands:['湿地日','02-02'], valentine:['情人节','02-14'], women:['妇女节','03-08'],
		arbor:['植树节','03-12'], white:['白色情人节','03-14'], fools:['愚人节','04-01'],
		earth:['地球日','04-22'], reading:['读书日','04-23'], youth:['青年节','05-04'],
		tobacco:['无烟日','05-31'], children:['儿童节','06-01'], environment:['环境日','06-05'],
		party:['建党节','07-01'], army:['建军节','08-01'], victory:['抗战胜利日','09-03'],
		teacher:['教师节','09-10'], halloween:['万圣夜','10-31'], evening:['平安夜','12-24'],
		christmas:['圣诞节','12-25'], father:['父亲节',v=>'06-'+(22-$.dateWeek(v+'/6/1'))],
		mother: ['母亲节', v=>{ v=15-$.dateWeek(v+'/5/1'); return '05-'+(v<10?'0'+v:v); }],
		thanks: ['感恩节', v=>{ v=$.dateWeek(v+'/11/1'); return '11-'+(v>4?33-v:26-v); }],
	},
});
